import {mapState,mapMutations} from 'vuex';

export default {
  name: "",
  data: () => ({
    userBalance:0,
    isLandlord:false,
    frozenBalance:0,      //冻结金额
    withDrawBalance:0,    //可提现金额
  }),
  computed: {

  },
  methods: {

  },
  updated() {
    //do something after updating vue instance
    let that = this;
  },
  watch:{

  },
  mounted() {
    //do something after mounting vue instance
    let that = this;
    that.$nextTick(()=>{

    let isLandlord = that.$route.query.isLandlord;
    that.isLandlord = isLandlord;
    console.log(isLandlord);
    if(isLandlord=='true'||isLandlord==true){
      console.log('房东');
      network.get(configUrl.LANDLORDWALLET_URL,'',function(res){
        console.log(res);
        that.userBalance = (res.data.userBalance/100).toFixed(2);
        that.withDrawBalance = (res.data.withDrawBalance/100).toFixed(2);
        that.frozenBalance = (res.data.frozenBalance/100).toFixed(2);
      },function(err){
        console.log(err);
      });
    }else{
      console.log('租客');
      network.get(configUrl.USERWALLET_URL,'',function(res){
        console.log(res);
        that.userBalance = (res.data.userBalance/100).toFixed(2);
      },function(err){
        console.log(err);
      });
    }

  });
  }
}
